<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="CSS/style.css" rel="stylesheet" type="text/css" />
        <title>Adicionando um novo Livro</title>
    </head>
    <body style="background-color:#E2E4E4">
        <c:import url="_templates/header.jsp" />
        <div class="conteudo">


            <table border ="1">
                <tr>
                    <th>ID</th>
                    <th>Nome</th>
                    <th>Autor</th>
                    <th>Editora</th>
                    <th>Preço</th> 
                    <th>Edição</th>                
                    <th>Editar Livro</th>
                    <th>Excluir Livro</th>
                </tr>

                <c:forEach var="lista" items="${requestScope.livrosList}">
                    <tr>    
                        <td>
                            <a>${lista.id}</a>
                        </td>
                        <td>${lista.nome}</td>
                        <td>${lista.autor}</td>
                        <td>${lista.editora}</td>
                        <td>${lista.preco}</td>
                        <td><fmt:formatDate value="${lista.edicao}"
                                        type="DATE"
                                        pattern="yyyy"/>
                        </td>
                        <td>
                            <a href="ServletLivros?cmd=atu&id=${lista.id}">                    
                                Editar
                            </a>
                        </td>

                        <td>
                            <a href="ServletLivros?cmd=exc&id=${lista.id}">
                                Excluir
                            </a>
                        </td>
                    </tr>
                </c:forEach>
            </table>
            <br />
        </div>
        <c:import url="_templates/footer.jsp" />
    </body>
</html>
